Document Sprite.filename specifics - #172
Open
Arecher wants to merge 3 commits into
Open
Conversation
- Added examples and explanation for the three different strings that sprite.filename can return (filepath, name only and "") - Added link to app.fs.fileTitle to show how to get the name of the Sprite - Added note that switching filenames for opened sprite only changes where the file is saved on subsequent save actions, and does not switch to the file at the new path. - Reference to `filenamechange` event for `Sprite.events`
Arecher
force-pushed
the
document-sprite-filename-specifics
branch
from
August 27, 2026 11:19
c599f98 to
c1e5279
Compare
Member
|
Sorry @Arecher, I've just pushed some old commits to the Sprite.filenames just today, so this PR is giving some conflicts, but probably you can just replace the latest content with your reword. |
Contributor
Author
|
Done! I'll make some changes though, because like your change mentioned, even sprites that don't have any files associated with them return their name (which seems to just be |
Contributor
Author
|
I couldn't squash/amend the commits because one of them is a merge. Wasn't aware of that, so it's a bit of a mess of small commits now. But the end result should be a properly merged file. I also removed my sentence that stated that |
- Removed incorrect description of `Sprite(width,height).filename` returning `""`. - Linked to `hasAssociatedFile()` in explanation
Arecher
force-pushed
the
document-sprite-filename-specifics
branch
from
August 27, 2026 19:08
6cd1541 to
ad09001
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
"")app.fs.fileTitleto show how to get the name of the SpriteSince filename sounds like it would return this, rather than the filepath
I wasn't fully sure what to expect from setting a filename during runtime, and since it originally mostly mentioned it was where the file was loaded from, I wondered whether it would switch the data in the sprite if you adjusted the filename to a preexisting sprite